package com.chaike.hsq.exception;

import com.chaike.hsq.consts.HsqMerchantEnum;
import com.chaike.hsq.consts.HsqPayEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * 慧收钱系统 接口 异常.
 *
 * @author Luo
 * @version 1.0
 * @date 2021-12-24 17:30
 **/
@Getter
@Setter
public class HuiShouQianException extends Exception {

    private static final long serialVersionUID = -7018782623990497946L;

    /**
     * 错误码.
     */
    private String errorCode;

    /**
     * 错误描述.
     */
    private String errorMsg;

    public HuiShouQianException(final String errorMsg) {
        super(errorMsg);
        this.errorMsg = errorMsg;
    }

    public HuiShouQianException(final String errorCode, final String errorMsg) {
        super(errorMsg);
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public HuiShouQianException(final HsqMerchantEnum.RespCode error) {
        super(error.getMessage());
        this.errorCode = error.getCode();
        this.errorMsg = error.getMessage();
    }

    public HuiShouQianException(final HsqPayEnum.RespCode resp) {
        super(resp.getMessage());
        this.errorCode = resp.getCode();
        this.errorMsg = resp.getMessage();
    }

    public HuiShouQianException(final Throwable cause) {
        super(cause);
    }

}
